package com.gis.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.gis.entity.User;

@Mapper
public interface UserMapper {
    @Select("select * from users where id=#{ID}")
    User findByID(Integer ID);

    @Select("select * from users")
    List<User> findAllUser();

    @Select("select * from users where username=#{username}")
    User FindByUserName(String username);

    @Insert("insert into users(username, password) " + 
            "values(#{username}, #{password})")
    void add(String username, String password);

    @Update("update users set username=#{username}, password=#{password} where username=#{username}")
    void update(String username, String password);
}